<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Product
 *
 * @author TOP   SYSTEM
 */
class Product {
    //put your code here
    public $Product_Name;
    public $Product_Id;
    public $Category_Id;
    public $Quantity;
    public $Price;
    public $Image_Src;
    public $Description;
    
    public function Select($id){
        $con=mysqli_connect("localhost","root","","book_market");
// Check connection
if (mysqli_connect_errno()) 
{
 echo "Failed to connect to MySQL: " . mysqli_connect_error();
 }
     $this->Product_Id= $id;
   $result=  mysqli_query($con,"SELECT * FROM product WHERE Product_Id='$this->Product_Id'") or die("Error". mysql_error());
   $w=mysqli_fetch_array($result);
   $this->Product_Name=$w['Product_Name'];
   $this->Quantity=$w['Quantity'];
   $this->Price=$w['Price'];
   $this->Description=$w['Description'];
 mysqli_close($con);
    }
}

?>
